package com.hnust.root.dao.entity.domain.forward;

import cn.hutool.db.DaoTemplate;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.util.Date;

//消息
@Data
@TableName("user_message")
public class UserMessage {
    private int id;

    //是否已读
    @TableField("flag")
    private boolean flag;

    @TableField("topic_id")
    private int topicId;
    //对应的话题
    @TableField(exist = false)
    private Topic topic;

    //此条消息对应的用户
    @TableField("to_open_id")
    private String toOpenId;
    @TableField(exist = false)
    private WxUserInfo ToUserInfo;

    //评论/回复/赞的用户
    @TableField("from_open_id")
    private String fromOpenId;
    @TableField(exist = false)
    private WxUserInfo fromUserInfo;

    /**
     * 消息的类型
     * liked:赞
     * comment：评论
     * reply：回复
     */
    @TableField("content_type")
    private String contentType;

    //消息创建时间
    @TableField("create_time")
    private Date updatedAt;
}
